1. Field of the Invention
The present invention relates to mapping an input color value in an input color space to an output color value in an output color space.
2. Description of the Related Art
Colors received as input to render at an output device are mapped from one color space to a color space used by the device rendering the input color value. Color conversion is performed if the output device, e.g., video controller, printer, storage, etc. processes data to render in a different format than the input color value. For instance, a color in an RGB (Red, Green and Blue) color space may be mapped to a CMYK (Cyan, Magenta, Yellow and Black), and vice versa. Further, many printers only have black ink, so their output color space comprises halftone color values. If the input color value is in a CMYK color space, then the CMYK color must be converted to the halftone or black (K) color value for rendering by the “black and white” printer.
One technique for converting input values in one color space to an output color space is to use a lookup table that provides a subset of all possible color values and a mapping from each input color value in the subset in the lookup table to a corresponding output color value in the output color space. For instance, if a CMYK color space provided 256 values (e.g., 8 bits) for each color component, then a lookup table including a mapping to an output color space for each possible CMYK value would be considerably large, e.g., 2564. To limit the size of the lookup table in the prior art, the lookup table has a mesh of possible values for each color component. For instance, the lookup table may provide m of the n possible values for each color component, where m is less than n. This restricts the size of the lookup table to m4, which may be considerable less than n4. The mesh of values for each color component encompass the range of all possible values for a color component, e.g., including 0 and n. If an input value did not match one of the m values for the input color space in the lookup table, then the system would determine a four dimensional geometric shape having vertices comprising values in the lookup table that enclose the input value. The conversion algorithm then performs quadlinear interpolation on the 16 vertices of this four dimensional shape and their corresponding output values in the output color space to determine the output color space value for the received input value. Quadlinear interpolation is a complex and computationally expensive operation and has a significant negative impact on the performance of the conversion algorithm.
There is a need in the art for improved techniques to map an input color value in an input color space to a value in an output color space.